/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.text.SimpleDateFormat;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.TimeUnit;

/**
 * <p>Project: jse2302 - TimeDemo
 * <p>Powered by webrx On 2023-06-30 11:45:42
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class TimeDemo {
    public static void main(String[] args) {
        Timer timer = new Timer();
        System.out.printf("%tF %<tT%n", System.currentTimeMillis());

        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.printf("%tF %<tT%n", System.currentTimeMillis());
                System.out.println("ok");
                //timer.cancel();
            }
        }, 5000,2000);





    }
}
